#!/usr/bin/python
# coding=utf-8

from second import Violin as vv


class RoomTalk:
    z = []
    x = []

    def __init__(self):
        print "欢迎使用fission类!"

    def getData(self, name):
        size = 0;
        with open("/Users/Vicky/Documents/workspace/api_test/long/" + name + ".log") as apidata:
            for i in apidata:
                data = i.split("\r\n")[0]
                time = float(data)
                if time > 2: continue
                self.z.append(data)
                size += 1;
        length = size;
        for i in range(length):
            self.x.append(name + "线程")


if __name__ == "__main__":
    vvv = vv.Violin()
    fission = RoomTalk()
    for i in range(10,23,1):
        aa = str((i + 1) * 10)
        fission.getData(aa)
    vvv.makeViolin(fission.z, fission.x, "接口性能测试", "110-230")
